﻿Public Class SystemInfo

    Public Function Test2() As String
        Dim ListIds = OpenNETCF.ToolHelp.ProcessEntry.GetProcesses

        Dim ListProcess = (From u In ListIds _
        Select System.Diagnostics.Process.GetProcessById(XCint(u.ProcessID))).ToList

        Dim S As String = ""

        For Each P In ListIds
            MsgBox(P.ProcessID & " " & P.ExeFile)
        Next

        For Each P In ListProcess
            S = P.Id & P.StartInfo.FileName & " " & P.StartInfo.Arguments & vbNewLine & P.StartInfo.WorkingDirectory
            MsgBox(S)
        Next

        Return ""
    End Function

    Private Function XCint(ByVal UI As UInteger) As Integer
        If UI <= Integer.MaxValue Then
            Return UI
        End If
        Dim UU As Int64
        UU = UI
        UU = UU - UInteger.MaxValue
        UU = UU - 1

        Return CInt(UU)
    End Function

    Public Function Test() As String
        Dim A = Microsoft.WindowsMobile.Status.SystemState.OwnerEmail
        A += Microsoft.WindowsMobile.Status.SystemState.OwnerName + vbNewLine
        A += Microsoft.WindowsMobile.Status.SystemState.OwnerNotes + vbNewLine
        A += Microsoft.WindowsMobile.Status.SystemState.OwnerPhoneNumber + vbNewLine
        A += OpenNETCF.Environment2.MachineName + vbNewLine
        A += OpenNETCF.Environment2.OSVersion.Platform.ToString + vbNewLine
        A += OpenNETCF.Environment2.OSVersion.Version.Build.ToString + vbNewLine
        A += OpenNETCF.Environment2.OSVersion.Version.Major.ToString + vbNewLine
        A += OpenNETCF.Environment2.OSVersion.Version.Minor.ToString + vbNewLine
        A += OpenNETCF.Environment2.OSVersion.Version.Revision.ToString + vbNewLine
        A += OpenNETCF.Environment2.OSVersion.Version.ToString + vbNewLine

        A += OpenNETCF.Environment2.SdfVersion.ToString + vbNewLine
        A += OpenNETCF.Environment2.UserName + vbNewLine
        A += OpenNETCF.Environment2.Version.ToString + vbNewLine
        A += OpenNETCF.WindowsCE.MemoryManagement.AvailablePhysicalMemory.ToString + vbNewLine
        A += OpenNETCF.WindowsCE.MemoryManagement.AvailableVirtualMemory.ToString + vbNewLine
        A += OpenNETCF.WindowsCE.MemoryManagement.MemoryLoad.ToString + vbNewLine
        A += OpenNETCF.WindowsCE.MemoryManagement.SystemProgramMemory.ToString + vbNewLine
        A += OpenNETCF.WindowsCE.MemoryManagement.SystemStorageMemory.ToString + vbNewLine
        A += OpenNETCF.WindowsCE.MemoryManagement.TotalPhysicalMemory.ToString + vbNewLine
        A += OpenNETCF.WindowsCE.MemoryManagement.TotalVirtualMemory.ToString + vbNewLine

        Dim SI As New OpenNETCF.WindowsCE.SystemInfo
        A += SI.NumberOfProcessors.ToString + vbNewLine
        A += SI.ProcessorArchitecture.ToString + vbNewLine
        A += SI.ProcessorType.ToString + vbNewLine

        Dim sii As OpenNETCF.WindowsCE.SystemInfo

        sii = OpenNETCF.WindowsCE.DeviceManagement.SystemInformation
        Dim aa = OpenNETCF.WindowsCE.DeviceManagement.GetDeviceID
        Dim bb = OpenNETCF.WindowsCE.DeviceManagement.OemInfo
        Dim cc = OpenNETCF.WindowsCE.DeviceManagement.PlatformName

        Dim B = OpenNETCF.Environment2.OSVersion.Platform


        Return A

    End Function
End Class
